/**
 * 共享证照 api js
 */
import request from "@/utils/request";

const baseURL = process.env.VUE_APP_BASE_API;

/**
 *
 * @param {*} data
 * 保存共享证照数据
 */
export function saveOrUpdate(data) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH + "/yxpz/shareLicense/saveOrUpdate",
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    data: data
  });
}

/**
 * 分页查询列表数据
 * @param {*} params
 */
export function pageList(params) {
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + "/yxpz/shareLicense/pageList",
    method: "post",
    params: params
  });
}

/**
 * 通过主键获取对象数据
 * @param {*} id
 */
export function getOne(id) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH + "/yxpz/shareLicense/getOne/" + id,
    method: "get"
  });
}

/**
 * 通过主键删除数据
 * @param {*} id
 */
export function del(id) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH + "/yxpz/shareLicense/delete/" + id,
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

/**
 * 查询所有一级的区划数据
 * @returns
 */
export function getRegionManageList() {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/yxpz/regionManage/getRegionManageList",
    method: "get"
  });
}

/**
 * 查询可用的证照目录list数据
 */
export function getShareLicenseList() {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/yxpz/shareLicense/getShareLicenseList",
    method: "get"
  });
}
